package com.example.szh.adapter;

import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.szh.R;
import com.example.szh.entity.LiveCommentEntity;
import com.example.szh.utils.LoadImage;
import com.tb.emoji.EmojiUtil;

import java.io.IOException;

public class LiveCommentAdapter extends BaseQuickAdapter<LiveCommentEntity.Values, BaseViewHolder> {
    public LiveCommentAdapter() {
        super(R.layout.item_comment);
    }

    @Override
    protected void convert(BaseViewHolder helper, LiveCommentEntity.Values item) {
        helper.setText(R.id.comment_item_fabulous_tv,"101");
        helper.setText(R.id.comment_item_name_tv,""+item.user_id);
        helper.setText(R.id.comment_item_time_tv,""+item.comment_time);
        helper.setText(R.id.comment_item_address_tv,"天津");
        TextView comment_item_values_tv = helper.getView(R.id.comment_item_values_tv);
        try {
            EmojiUtil.handlerEmojiText(comment_item_values_tv, item.comment_value, mContext);
        } catch (IOException e) {
            e.printStackTrace();
        }
        ImageView headImg=helper.getView(R.id.comment_item_head_img);
        LoadImage.loadCircleImg(item.user_img,headImg);
    }
}
